#!/bin/bash
# run verdi for sm3_core_lite
# ljgibbs Apr. 2022

SM3_FILE_LIST=sm3_core_lite.f

if [ ! $SM3_CORE_DIR ];then
    SM3_CORE_DIR=`pwd`
    echo "[INFO] Set current dir, SM3_CORE_DIR=${SM3_CORE_DIR}"
    VERDI='/tools/synopsys/verdi/verdi/Verdi_O-2018.09-SP2/bin/verdi'
    echo "[INFO] Set VERDI path=${VERDI}"
else
    echo "[INFO] Read env, SM3_CORE_DIR=${SM3_CORE_DIR}"
fi

if [ -e $SM3_FILE_LIST ]; then
    rm $SM3_FILE_LIST -f
fi

touch $SM3_FILE_LIST
find $SM3_CORE_DIR/src -name "*.*v" >> $SM3_FILE_LIST
find $SM3_CORE_DIR/sub -name "*.*v" >> $SM3_FILE_LIST
find $SM3_CORE_DIR/inc -name "*.*v" >> $SM3_FILE_LIST

$VERDI -f $SM3_FILE_LIST +incdir+$SM3_CORE_DIR/inc &

